
/**
 * @Project : Clion_ProgrammingExercises
 * @File : 0792
 * @Author : WangRuoyu 
 * @Date : 2023/9/13 15:56
 */

#include "iostream"
#include "vector"

using namespace std;

int cmp(vector<int> a, vector<int> b) {
    if (a.size() > b.size()) {
        return 1;
    }
    if (a.size() < b.size()) {
        return -1;
    }
    for (int i = a.size() - 1; i >= 0; --i) {
        if (a[i] > b[i]) {
            return 1;
        } else if (a[i] < b[i]) {
            return -1;
        }
    }
    return 0;
}

vector<int> sub(vector<int> &a, vector<int> &b) {
    vector<int> c;
    int t = 0;
    for (int i = 0; i < a.size(); ++i) {
        int tmp = a[i] + t;
        if (i < b.size()) {
            tmp -= b[i];
        }
        if (tmp < 0) {
            t = -1;
            tmp += 10;
        } else {
            t = 0;
        }
        c.push_back(tmp);
    }

    while (c.size() > 1 && c.back() == 0) c.pop_back();

    return c;
}

int main() {
    string sa, sb;
    cin >> sa >> sb;
    vector<int> a, b;
    for (int i = sa.size() - 1; i >= 0; --i) {
        a.push_back(sa[i] - '0');
    }
    for (int i = sb.size() - 1; i >= 0; --i) {
        b.push_back(sb[i] - '0');
    }

    vector<int> c;
    if (cmp(a, b) == 1) {
        c = sub(a, b);
    } else if (cmp(a, b) == 0) {
        puts("0");
        return 0;
    } else {
        c = sub(b, a);
        printf("-");
    }

    for (int i = c.size() - 1; i >= 0; --i) {
        printf("%d", c[i]);
    }

    return 0;
}